package com.it.gw.dialog

import android.app.Dialog
import android.content.Context
import com.android.tu.loadingdialog.LoadingDailog


/**
 *  @Description：
 *  @author：weishixiong
 *  @date：2023-05-05 10:26
 *
 */
object ProgressDialog {
    private var dialog: Dialog? = null

    fun show(context: Context, title: String? = "请稍后...") {
        runCatching {
            val loadBuilder = LoadingDailog.Builder(context)
                .setMessage(title)
                .setCancelable(true)
                .setCancelOutside(true)
            dialog = loadBuilder.create()
            dialog?.show()
        }
    }

    fun hide() {
        runCatching {
            dialog?.dismiss()
        }

    }

}